/**
 * Copyright: Copyright (c)2011
 * Company: 易宝支付(YeePay)
 */
package net.loyintean.pearlshell.base.model.impl;

import java.util.Map;

import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;

/** @author：jun.lin@yeepay.com
 * @since：2015年4月5日 上午1:51:29
 * @version: */
class ResultHandler4TotalCount implements ResultHandler {

	private int totalCount;

	private String totalCountKey = "totalCount";

	/** @see org.apache.ibatis.session.ResultHandler#handleResult(org.apache.ibatis.session.ResultContext) */
	@Override
	public void handleResult(ResultContext context) {

		@SuppressWarnings("rawtypes")
		Map map = (Map) context.getResultObject();

		totalCount = (Integer) map.get(totalCountKey);

	}

	/** totalCount
	 *
	 * @return the totalCount */
	protected int getTotalCount() {
		return totalCount;
	}

	/** @param totalCountKey
	 *            the totalCountKey to set */
	protected void setTotalCountKey(String totalCountKey) {
		this.totalCountKey = totalCountKey;
	}
}
